import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/index.vue'
import Login from '../views/Login.vue'
import Cart from '../views/Cart.vue'
import Order from '../views/Order.vue'
import Register from '../views/register.vue'
import BookDetials from '../views/BookDetails.vue'
import BooksList from '../views/BooksList.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index',
  },
  {
    path: '/index',
    name: 'Index',
    component: Index
  },
  {
    path: '/login',
    name: 'Login',
    component: Login

  },

  {
    path: '/cart',
    name: 'Cart',
    component: Cart
  },
  {
    path: '/order',
    name: 'Order',
    component: Order
  },
  {
    path: '/register',
    name: 'Register',
    component: Register
  },
  {
    path: '/bookDetails',
    name: 'BookDetials',
    component: BookDetials
  },
  {
    path: '/booksList/:category',
    name: 'BooksList',
    component: BooksList
  },

]

const router = new VueRouter({
  routes
})

export default router
